<!-- MyReactive.vue -->

<script lang="ts" setup>
  import { reactive } from 'vue'

  const user = reactive({
    name: "Maya",
    age: 20
  })

  // /*
  // TypeScript error - property 'value' does not exits
  // on type '{ name: string ; age: number;}'
  // */
  // user.value = {
  //   name: "Samuel",
  //   age: 20
  // }

  // /*
  // TypeScript error - cannot reassign a read-only variable
  // */

  // user = {
  //   name: "Samuel",
  //   age: 20
  // }

  // 正确的
  user.name = "Rachel"
  user.age = 30


</script>
